That's neat Hans. Thanks. Especially didn't know about \writedatatolist.
What I want is basically to manually construct a toc entry, but in compliance
with the overall styling of the contents list.
So, I was hoping for something like this?
\writetolist[chapter][location=here,pagenumber=4]{5
}
\placelist[chapter]
\chapter{one}
\writebetweenlist[chapter][location=here]{\blank page 4\blank}
\writedatatolist[chapter][location=here][pagenumber=4]
\writetolist[chapter]{}{It's a test}
\chapter{two}
\stoptext
wikifyable
Hans
\unexpanded\def\writebetweenlist{\dodoubleempty \strc_lists_write_between}
\unexpanded\def\writedatatolist {\dotripleargument\strc_lists_write_data_to}
\unexpanded\def\writetolist {\dodoubleempty \strc_lists_write_to}
\def\strc_lists_write_between[#tag]%
{\begingroup
\edef\currentlist{#tag
...
\dowritedatatolist ...eter {#1}\c!state }\v!start
{\structurelistinject [#1]...
\docitation ...\writedatatolist [pubs][bibref=#1]}
\fi
\next1498 #1,-\docitation {#1
\doglobal\increment\citationnumber
\expanded{\rawreference{}{cite-\jobname-\citationnumber}{#1}}%
\fi \fi
\expanded{\writedatatolist[pubs][bibref=#1]}}
%
If you turn cite compression off, it will now work (somewhat, at least).
With compression on, there is backward